import pickle

class _Serialize:
    def dump(self):
        return pickle.dumps(self)
    @classmethod
    def load(cls,o):
        return pickle.loads(o)
        
class Transcode(_Serialize):
    def __init__(self,videoid):
        self.videoid = videoid
    sztube = 'video.transcode'
    
class Catalog(_Serialize):
    def __init__(self,videoid):
        self.videoid = videoid
    sztube = 'video.catalog'
    
if __name__ == '__main__':

    o = Transcode(1)
    d = o.dump()
    o2 = Transcode.load(d)
    assert(isinstance(o2,Transcode))

    #mylog.info(o)